﻿<?php
require_once APPPATH.'presenters/news_presenter.php';
require_once APPPATH.'presenters/activities_presenter.php';
require_once APPPATH.'presenters/questions_presenter.php';
class Home extends CI_Controller{

	public function __constructor()
	{
		parent::__construct();
	}

	//Функција за приказ на информации на главната страна.
	//Последни 4 додадени вести, активности и прашања.
	public function index(){
		$this->load->model('news_model');
		$this->load->model('activities_model');
		$this->load->model('questions_model');
		$data['include']='home';
		$data['title'] = 'ФИНКИ - Факултет за информатички науки и компјутерско инженерство';
		$data['news'] = new news_presenter($this->news_model->getLimit(4,0,array("language"=>$this->session->userdata('ln')),'dateAdded','desc'));	
		$data['activities'] = new activities_presenter($this->activities_model->getLimit(4,0,array("language"=>$this->session->userdata('ln')), "dateAdded", "desc"));
		$data['questions'] = new questions_presenter($this->questions_model->getLimit(4,0,array("language"=>$this->session->userdata('ln')), "dateAdded", "desc"));
		
		$this->load->view('masterPage', $data);
	}	
}
?>